import { FORM_SUBMIT, IS_SHOW_MODAL } from './actionCreator'
const defaultState = {
  formResult: {},
  isModal: false
}

export default (state = defaultState, action) => {
  // 拷贝数据 修改数据  返回确定数据
  const newState = JSON.parse(JSON.stringify(state))
  if (action.type === FORM_SUBMIT) {
    newState.formResult = action.data
  }
  if (action.type === IS_SHOW_MODAL) {
    newState.isModal = action.data;
  }
  return newState;
}